#include <iostream>
#include <set>
#include <algorithm>
using namespace std;

int main(){
	set<int> col1;
	
	// insert elements from 1 to 9
	for(int i=1;i<=9;i++){
		col1.insert(i);
	}
	
	// print all elements of the collection
	copy(col1.begin(),col1.end(),ostream_iterator<int>(cout," "));
	cout << endl;
	
	int num = col1.erase(3);
	
	// print number fo removed elements
	cout << "number of removed elements: " << num << endl;
	
	// print all elements of the modified collection
	copy(col1.begin(),col1.end(),ostream_iterator<int>(cout," "));
	cout << endl;
	return 0;
}